clearvars -except Globaloption option

if exist('Globaloption', 'var') == 0
    Globaloption.savefig = 1;
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This code reads in the VAR dynamics and produce the Campbell-Shiller decomposition in the paper
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Load data

loaddata_4CIjoint_annual_cy_partial_1760;
output_rp = 0.03 - mean(cy);

ttime = [startdatenum:enddatenum];

filename = ['MAT/cy_UK_30_1760'];

%% Estimation
run ../../tools/cs_estimation;

%% steady-state upper bound calculation
upper = exp(pxbar)*(mean(taxrevgdp-spendgdp));

%% bootstrap
run ../../tools/BS_compute;

save (filename, 's', 'std_coeff', 'gdebt', 'upper');

